﻿using System.Collections.Generic;
using Microsoft.Practices.Unity;
using UnityDemo.LoggingUtility;
using UnityDemo.Models;

namespace UnityDemo.RegAndResCode
{
    internal class RegistrationCollection : ISample
    {
        public RegistrationCollection()
        {
            SeeAllRegisteredMemebers();
        }

        private void SeeAllRegisteredMemebers()
        {
            var container = new UnityContainer();
            IEnumerable<ContainerRegistration> members = container.Registrations;
            foreach (ContainerRegistration registeredMember in members)
            {
                LogerInstance.Logger.Write(registeredMember.MappedToType.AssemblyQualifiedName);
            }
        }
    }
}